#pragma once
#include <cstdint>

using namespace std;

namespace hammingWeight
{
	class Solution {
	public:
		int hammingDistance(int x, int y) {
			int n = x ^ y;
			int r = 0;
			while (n)
			{
				n = n & (n - 1);
				r++;
			}
			return r;
		}
	};
}
